<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>系统首页</title>
	<style type="text/css">
		*{
			margin: 0;
			padding: 0;
		}
		body{
			font-family: "Microsoft YaHei";
			background: #fff;
		}
		h1,h2,h3,h4,h5,h6,b{
			font-weight: normal;
		}
		li{
			list-style: none;
		}
		a{
			text-decoration: none;
		}
		.must-h:before{
			content: "* ";
			color: red;
		}
		.main-title-h2-h{
			color: #999;
			margin-top: 14px;
			padding: 8px 40px;
			line-height: 25px;
			font-size: 18px;
			border-bottom: 1px solid #ececec;
		}
		.main-container-h{
			padding: 0 40px;
		}
		.title-h{
			border-left: 5px solid #1188f6;
			padding-left: 7px;
			margin-top: 30px;
			margin-bottom: 10px;
			line-height: 16px;
			color: #676a6c;
			font-size: 13px;
		}
		.form-row-h{
			margin-top: 20px;
			color: #333;
		}
		.label-required-h{
			width: 115px;
			text-align: right;
			height: 30px;
			line-height: 30px;
			margin: 0;
			padding: 0;
			font-size: 14px;
			color: #000;
			font-weight: 400;
		}
		.input-required-h{
			margin-left: 20px;
			width: 437px;
			font-size: 14px;
			color: #333;
			font-weight: 400;
			border: 1px solid #eee;
			height: 30px;
			padding: 0 10px;
		}
		.tips-h{
			font-size: 12px;
			color: #999;
		}
		/*----------------button公共部分----------------*/
		.form-btn-container-h{
			
		}
		.btn-h{
			box-sizing: border-box;
			height: 32px;
			min-width: 90px;
			font-size: 14px;
			display: inline-block;
			text-align: center;
			border-radius: 2px;
			border: none;
			line-height: 32px;
			outline: none;
			color: #fff;
			width: 90px;
			cursor: pointer;
		}
		.btn-success-h{
			background: #1E9FFF;
		}
		.btn-warning-h{
			background: #f0ad4e;
		}
		.btn-danger-h{
			background: #d9534f;
		}
		.btn-default-h{
			background: #fff;
			color: #333 !important;
			border: 1px solid #ddd !important;
		}
		/*-----------flex公共部分----------*/
		.flex-h{
			display: flex;
		}
		.flex-d-col-h{
			flex-direction: column;
		}
		.flex-ai-center-h{
			align-items: center;
		}
		/*----------------内边距外边距公共部分-----------------*/
		.pl-130-h{
			padding-left: 130px!important;
		}
		.pb-100-h{
			padding-bottom: 100px!important;
		}
		.pt-40-h{
			padding-top: 40px!important;
		}
		.mat-20-h{
			margin-top: 20px !important;
		}
		.mal-20-h{
			margin-left: 20px !important;
		}
		.mar-10-h{
			margin-right: 10px !important;
		}
		.mar-20-h{
			margin-right: 20px !important;
		}
	</style>
</head>
<body>
	<!--<h2 class="main-title-h2-h">设置</h2>-->
	<form method="post" action="" id="form1" >
	<div class="main-container-h">
		<!--<h4 class="title-h">基本配置</h4>-->
		<div class="flex-h form-row-h">
			<label class="label-required-h must-h">标签名称:</label>
			<input type="text" name="tag_name" class="input-required-h" placeholder="标签名称" required="required" />
		</div>
	</div>
	<div class="form-btn-container-h pl-130-h pb-100-h pt-40-h">
		<button class="btn-h btn-success-h mar-20-h" type="button" onclick="tijiao()">提交</button>
	</div>
	</form>
</body>
<script src="/layui/layui.js"></script>
<script src="/js/ajax.js"></script>
<script type="text/javascript">
	function tijiao(){
		$('.help-inline').remove();
		var cansv= true;
		$('#form1').find('input[type="text"]').filter('[required="required"]').each(function(){
			if($.trim($(this).val())==''){
				cansv = false;
				var ntip = $('<span class="help-inline" style="color:red">该项内容不能为空</span>');
				$(this).after(ntip.show());
				$(this).one('blur',function(){
		            ntip.remove();
		        });
			}
		});
		
		if(cansv){
			//$('#form1').submit();//验证成功进行表单提交
			var formData = $('#form1').serialize();	
			myAjaxPost(false, true, '', formData, function (resp) {
				if (resp.status == 'success') {
					tusi(resp.msg);
					setTimeout(function(){ 
						parent.layer.closeAll('iframe');
						parent.location.reload(); 
					},2000);
				}else{
					alert(resp.msg);
				}
			});
		}
		
	}
</script>
</html>